Project 4: AutoStitching Photo Mosaics¶

By Jathin Korrapati¶

Part A: Image Warping and Mosaicing¶

Part 0: Image Pre-processing¶

These are the base images I took from my room:¶

No description has been provided for this image

Some BWW images:¶

No description has been provided for this image
No description has been provided for this image

Part 1: Recover Homographies¶

For this part, we must find a way to map the correspondences between the source points and the target points, and used the SVD approach (which seemed to yield better results for me for some reason), where two vectors for each pair of correspondence points:¶

H_x = (-x_i, -y_i, -1, 0, 0, 0, x_j * x_i, x_j * y_i, x_j)¶

H_y = (0, 0, 0, -x_i, -y_i, -1, y_j * x_i, y_j * y_i, y_j)¶

After this, the vectors are stacked into a matrix A, which we then compute the SVD of to get S, U, and Vt. The last row of Vt corresponds to the smallest singular value and contains the elements of the flattened homography matrix. Then, we simply reshape it into a 3x3 matrix, and then scale it downwards to normalize the transform back for our Homography Matrix.¶

Here are each of my images labeled with corresponding points:¶

No description has been provided for this image
No description has been provided for this image
No description has been provided for this image

Part 2: Image Warping¶

Now, given the homography and an image, we can warp the perspective of our input image to the target perspective. In our input to warpImage, our inputs are defined as the image we want to warp, and its corresponding homography to the target image. We first compute the new corners of the image by applying the Homography matrix on the old corners of the image to create our bounding box. Then, I determine the pixel locations of the warped image and apply the inverse homography matrix to find the original points of our input image, and then apply our inverse warp to fill the corresponding pixels.¶

Part 3: Image Rectification¶

Using our warp and homography function from before, we can now take a picture of a rectangular object and warp it to the parallel plane in order to match it towards the front frame. We can manually set the correspondences to make the rectangle/square face the parallel plane.¶

Here is my notebook and its rectification:¶
No description has been provided for this image
Here is my mouse and its rectification:¶
No description has been provided for this image

Part 4: Mosaic Blending¶

To blend my mosaics, I take a naive approach and then apply simple alpha blending in order to normalize the colors between the overlapping regions better. The first thing I do is calculate the overlap, and then blend the images together. But that led to some strange artifacts, so then I apply alpha blending in order to smooth out the intersection region. This seems to work decently well, as it seems to smooth it out more. Any refractions or projections seem to stem from slightly inconsistent lighting and slight miscorrespondences using the tool.¶

No description has been provided for this image
(640, 480, 3)
181
No description has been provided for this image
(640, 480, 3)
252
No description has been provided for this image